#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  httperror.py
#       Author @  Huoty
#  Create date @  2015-06-19 15:38:17
#  Description @  
# *************************************************************

import urllib2

# Script starts from here

req = urllib2.Request("http://blog.csdn.net/cqcre")
try:
    urllib2.urlopen(req)
except urllib2.HTTPError, e:
    print e.code
    print e.reason
